<?php
/**
 * 内存表：
 * 使用场景：多进程数据共享数据
 * User: ahao
 * Email: 827316006@qq.com
 * Date: 2019/12/2 21:22
 */

$table = new swoole_table(1024);

//内存表增加一行
$table->column("id",$table::TYPE_INT,4);
$table->column("name",$table::TYPE_STRING,64);
$table->column("age",$table::TYPE_INT,3);
$table->create();

$table->set('singwa_imooc',['id' => 1, 'name' => 'ahao', 'age' => 30]);

//另外一个方案
$table['singwa_imooc_2'] = ['id' => 1, 'name' => 'ahao', 'age' => 30];

//加减
$table->incr('singwa_imooc_2','age',2);

print_r($table->get('singwa_imooc'));

$table->del('singwa_imooc_2');



